home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.10 Oct 88 / MSSourcesLong / MS.h < prev    next >
Encoding:
Text File  |  1988-01-18  |  4.0 KB  |  151 lines  |  [TEXT/EDIT]

  1. /*_______________________________
  2.  
  3.             MSmeta.h
  4.  
  5.     Source file for MSMeta.p
  6.     20 Oct 87
  7.  
  8.   _____________________________*/
  9. //#include "Mytools.p"
  10.  
  11. /*    ___________    Menu Verb Codes    ___________________*/
  12.  
  13. #define    _MVNORMAL    0
  14. #define    _MVCHKTOG    1
  15. #define    _MVTEXTOG    2
  16. #define    _MVENABPR    3
  17. #define    _MVNZEXRG    4
  18. #define    _MVCMRGRS    5
  19. #define    _MVENBSET    6
  20. #define    _MVTTGSET    7
  21. #define    _MVMENLIN    -128
  22.  
  23. /*    ___________    Menu Flags    ___________________*/
  24.  
  25. #define    _MFSYSLOD    0
  26. #define    _MFERRTRM     1 
  27. #define    _MFEXPRNG    2
  28. #define    _MFALOCTB    3
  29. #define    _MFBLDTAB    4
  30. #define    _MFSETXRG    5
  31. #define    _MFSETPRE    6
  32. #define    _MFSUBMEN    7
  33. #define    _MFHASSTR    8
  34. #define    _MFPRCPAR    9
  35. #define    _MFPRCFLG    14    
  36.  
  37.  
  38. //__________________    MIVT Codes    __________
  39. #define    _MSMIVTOK    0
  40. #define    _MSMIVTER    (-10)
  41. #define    _MSMIVTST    256
  42. #define    _MSMIVTDY    512
  43. #define    _MSMIVTAL    768
  44.  
  45.  
  46.  
  47. /*__________________    Resource Strings _____*/
  48. #define    _MSMSTTYP    'MST '
  49. #define    _MSSTRTYP    'STR#'
  50. #define    _MSPRCTYP    'PROC'
  51. #define    _MSPRVTYP    'MST1'
  52. #define    _MSCFGTYP    'MSTx'
  53.  
  54. /*__________________    TypeDefs    __________________*/
  55. typedef    char        MVOpCode;
  56. typedef    char        MVArgT;
  57. #define    _MVARGDIM        5
  58. typedef    struct
  59. {
  60.     MVOpCode    opCode;
  61.     MVArgT        argT[_MVARGDIM];
  62. }MenuVerb;
  63. typedef    MenuVerb    ToggleFlag;
  64. #define    _TFBITSZE    (sizeof(ToggleFlag)*8-1)
  65.  
  66. typedef struct
  67. {
  68.     MenuHandle        MH;
  69.     long            sysRes;
  70.     long            **MIVTH;
  71.     long            procID[2];
  72.     long            MIVTdefVal;
  73.     long            MIVTnullVal;
  74. //
  75.     short            staticCount;
  76.     short            allocCount;    
  77.     short            beforeID;
  78.     short            ttgStrID;
  79. //
  80.     ToggleFlag        TF;
  81.     MenuVerb        MVT[_TFBITSZE+1];
  82. }MenuStuff;
  83. typedef MenuStuff        *MSPtr;
  84. typedef MSPtr            *MSHdl;
  85. #define    _MSFIXLEN        42
  86.  
  87. typedef struct
  88. {    
  89.     short            dbgFlg;
  90.     short            relFlg;
  91.     short            alrtID;
  92.     short            errStrID;
  93.     short            prgStrID;
  94.     short            altErrStrID;
  95.     short            altPrgStrID;
  96. }MSConfig;
  97.  
  98. //____________    Externals    _____________
  99. extern    MSHdl        MSGetMSH();
  100. extern    MSConfig    MSInit();
  101.  
  102. /* _________________ Error String ID's ___________*/
  103. #define    _MSERR01    1    /* MSH Invalid */
  104. #define    _MSERR02    2    /* MH Invalid */
  105. #define    _MSERR03    3    /* MIVTH Invalid */
  106. #define    _MSERR04    4    /* PROC Hdl Invalid - item means PROC 1 or 2*/
  107. #define    _MSERR05    5    /* PROC returns  0 - item means PROC 1 or 2 */
  108. #define    _MSERR06    6    /* Set TOG/MEN without Expanded Range flag */
  109. #define    _MSERR07    7    /* TxTg STR# Invalid */
  110. #define    _MSERR08    8    /* Indx STR Invalid */
  111. #define    _MSERR09    9    /* EX RG ONLY for NZEXRG */
  112. #define    _MSERR10    10    /* PROC ID and MIVTfct= 0 */
  113. #define    _MSERR11    11    /* UNDEFINED ERROR*/
  114. #define    _MSERR12    12    /* PREVH invalid */
  115. #define    _MSERR13    13    /* ResError <> 0 */
  116. #define    _MSERR14    14    /* Def ArgT Parsing : one but not both first/last =0 */ 
  117. #define    _MSERR15    15    /* Def ArgT Parsing : No PREV or NEXT line Group for ENBSET */ 
  118. #define    _MSERR16    16    /* Def ArgT Parsing : rel parent not in [first,last] */ 
  119. #define    _MSERR17    17    /* Dynamic Items : can't add/delete anymore items */ 
  120. #define    _MSERR18    18    /* MSMake Validation : StaticCount > AllocCount  */ 
  121. #define    _MSERR19    19    /* MSMake Validation : TogFlg[i]≠0, opCode[i]≠ NORMAL or MENLIN  */ 
  122. #define    _MSERR20    20    /* MSMake Validation : Unknown opCode  */ 
  123. #define    _MSERR21    21    /* MSMake Validation : TogFlg[i]≠0, i > StaticCount  */ 
  124. #define    _MSERR22    22    /* MSMake Validation : Handle NE allocCount */ 
  125. #define    _MSERR23    23    /* MSSignal : Continue button */
  126. #define    _MSERR24    24    /* Dynamic Items : TTGTOG & TTGSET not implemented */
  127.  
  128. /* _________________ ProgName ID's ___________*/
  129. #define    _MSPRG01    1    /* MSMake */
  130. #define    _MSPRG02    2    /* MSDispatch */
  131. #define    _MSPRG03    3    /* MSDispatch1 */
  132. #define    _MSPRG04    4    /* MSInsert */
  133. #define    _MSPRG05    5    /* MSDispose */
  134. #define    _MSPRG06    6    /* MSGetTog */
  135. #define    _MSPRG07    7    /* MSGetMIVT */
  136. #define    _MSPRG08    8    /* MSAdjTog */
  137. #define    _MSPRG09    9    /* MSTogBit */
  138. #define    _MSPRG10    10    /* MSAdjPREV */
  139. #define    _MSPRG11    11    /* MSDispatch2 */
  140. #define    _MSPRG12    12    /* MSInsMenuItem */
  141. #define    _MSPRG13    13    /* MSDelMenuItem */
  142. #define    _MSPRG14    14    /* MSShift */
  143. #define    _MSPRG15    15    /* MSFindMIVT */
  144. #define    _MSPRG16    16    /* MSCallProc */
  145. #define    _MSPRG17    17    /* PROC Fct */
  146. #define    _MSPRG18    18    /* MSSetMIVT */
  147. #define    _MSPRG19    19    /* MSGetIndStr */
  148. #define    _MSPRG20    20    /* MSValidation */
  149. #define    _MSPRG21    21    /* Non-MS Function */
  150.  
  151.